class MinStack:
    def __init__(self):
        """
        initialize your data structure here.
        """
        self.memory = []
        self.min_num = float("inf")

    def push(self, x: int) -> None:
        self.memory.append(x)
        self.min_num = min(x, self.min_num)

    def pop(self) -> None:
        mid_num = self.memory.pop(-1)
        if mid_num == self.min_num:
            try:
                self.min_num = min(self.memory)
            except:
                self.min_num = float("inf")

    def top(self) -> int:
        return self.memory[-1]

    def getMin(self) -> int:
        return self.min_num


obj = MinStack()
obj.push(-2)
obj.push(0)
obj.push(-3)
print(obj.getMin())
obj.pop()
print(obj.top())
print(obj.getMin())